/*
 * Project 1 phase 1
 * Efim Todorasco and Liviu Patrasco  
 */
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;

public class Ellipse extends SceneGraphNode {
	
	public Ellipse() {
		this(true);
	}

	public Ellipse(boolean pickable) {
		super(pickable);
	}

	public void renderGeometry(GLAutoDrawable drawable) {
		float pieces = 50;
		GL2 gl = drawable.getGL().getGL2();
		gl.glBegin(GL.GL_TRIANGLE_FAN);
		gl.glColor3f(.3f, .5f, 0);
		gl.glVertex2f(0, 0);
		for(int i = 0; i <= pieces; i++)
		{
			gl.glColor3f(.9f, -.2f, 0);
			gl.glVertex2f((float)(Math.cos(i * 2*Math.PI / pieces)), 
					(float)(Math.sin(i * 2*Math.PI / pieces)*.5));
		}
		gl.glEnd();
	}
}